package com.puge.cmssservice.controller;


import com.puge.commonutils.R;
import com.puge.cmssservice.entity.CrmBanner;
import com.puge.cmssservice.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-06-29
 *
 * 用户使用的前台接口
 */
@RestController
@RequestMapping("/educmss/bannerfront")
@CrossOrigin   //解决跨域问题
@Service
public class BannerFrontController {


    @Autowired
    private CrmBannerService bannerService;

    //查询所有的banner
    @GetMapping("getAllBanner")
    public R getAllBanner(){
        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list",list);
    }
}
